Google Go

推荐列表 站点导航

当前位置:首页 > 脚本编程 > Google Go >

类似于Windows下的INI文件. 配置文件形式为[section] 的段构成

来源:网络  作者:网友投稿  发布时间:2021-01-13 00:21
configPackageconfigisaConfigurationfileparserforINIformat包config是一个简捷方的,支持注释的Go语言设置文件理会器,雷同于Windows下的...

key2,key3,key3,key2。

Package config is a Configuration file parser for INI format 包 config 是一个简捷方的,error)Set(key string, err := NewConfig(testdata/testini.ini)c.Int(port)// result is int 8080c.Int64(port)// result is int64 8080c.Float64(f64)// result is float64 64.1c.String(host)// result is string act.wikic.String(mysql.host)// result is string 127.0.0.1c.String(redis.host)// result is string 127.0.0.3c.Strings(redis.key)// result is []string{key1, value string) error更多信息所有字符理会均利用小写的!源码 https://github.com/lxmgo/config ,可以安排于任意的单唯一行中. 安装go get github.com/lxmgo/config示例 请查察 conf.ini 文件作为利用示例 利用类型 示例设置文件: [DEFAULT]host = act.wikiport = 8080f64 = 64.1[mysql]host = 127.0.0.1[mongodb]host = 127.0.0.2[redis]host = 127.0.0.3push_key = key1,...[memcache]host = 127.0.0.4 加载设置文件: config,支持注释的Go语言设置文件理会器,...}config APIS:String(key string) stringStrings(key string) []stringBool(key string) (bool,雷同于Windows下的INI文件. 设置文件形式为[section] 的段组成, 内部利用 name=value键值对 假如为指定段节点,则默认放入名为[default]的段傍边. #为注释的开头, error)Int64(key string) (int64, error)Float64(key string) (float64, error)Int(key string) (int,。

相关热词:

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://v30.fanwenzhu.com/jiaob/go/12470.shtml

最新文章
Lisp进修Windows下面的开拓情 Lisp进修Windows下面的开拓情

时间:2021-01-12

Lisp进修Windows下面的开拓情 Lisp进修Windows下面的开拓情

时间:2021-01-12

为Go语言GC正名-2秒到1毫 为Go语言GC正名-2秒到1毫

时间:2020-12-27

go语言初探 一个helloworld编 go语言初探 一个helloworld编

时间:2020-12-27

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

类似于Windows下的INI文件. 配置文件形式为[section] 的段构成

2021-01-13 编辑:网友投稿

key2,key3,key3,key2。

Package config is a Configuration file parser for INI format 包 config 是一个简捷方的,error)Set(key string, err := NewConfig(testdata/testini.ini)c.Int(port)// result is int 8080c.Int64(port)// result is int64 8080c.Float64(f64)// result is float64 64.1c.String(host)// result is string act.wikic.String(mysql.host)// result is string 127.0.0.1c.String(redis.host)// result is string 127.0.0.3c.Strings(redis.key)// result is []string{key1, value string) error更多信息所有字符理会均利用小写的!源码 https://github.com/lxmgo/config ,可以安排于任意的单唯一行中. 安装go get github.com/lxmgo/config示例 请查察 conf.ini 文件作为利用示例 利用类型 示例设置文件: [DEFAULT]host = act.wikiport = 8080f64 = 64.1[mysql]host = 127.0.0.1[mongodb]host = 127.0.0.2[redis]host = 127.0.0.3push_key = key1,...[memcache]host = 127.0.0.4 加载设置文件: config,支持注释的Go语言设置文件理会器,...}config APIS:String(key string) stringStrings(key string) []stringBool(key string) (bool,雷同于Windows下的INI文件. 设置文件形式为[section] 的段组成, 内部利用 name=value键值对 假如为指定段节点,则默认放入名为[default]的段傍边. #为注释的开头, error)Int64(key string) (int64, error)Float64(key string) (float64, error)Int(key string) (int,。

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://v30.fanwenzhu.com/jiaob/go/12470.shtml

相关文章

风云图片

推荐阅读

返回Google Go频道首页